package 拓扑排序;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static int N = 100010, n, m, idx, k;
    public static int[] h = new int[N];
    public static int[] e = new int[N];
    public static int[] ne = new int[N];
    public static int[] d = new int[N];
    public static int[] top = new int[N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        m = in.nextInt();
        Arrays.fill(h, -1);
        for (int i = 0; i < m; i++) {
            int a = in.nextInt();
            int b = in.nextInt();
            add(a, b);
            d[b]++;
        }
        if (topsort()) {
            for (int i = 0; i < n; i++) {
                System.out.print(top[i] + " ");
            }
        } else {
            System.out.println(-1);
        }
    }

    private static boolean topsort() {
        Queue<Integer> q = new LinkedList<>();
        for (int i = 1; i <= n; i++) {
            if (d[i] == 0) {
                q.offer(i);
            }
        }
        while (!q.isEmpty()) {
            int t = q.poll();
            top[k++] = t;
            for (int i = h[t]; i != -1; i = ne[i]) {
                int j = e[i];
                d[j]--;
                if (d[j] == 0) {
                    q.offer(j);
                }
            }
        }
        return k == n;
    }

    private static void add(int a, int b) {
        e[idx] = b;
        ne[idx] = h[a];
        h[a] = idx++;
    }
}